package com.forum.module.system.controller.admin.auth.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Length;

/**
 * 认证登录
 *
 * @author zihan.ouyang
 */
@Schema(description = "管理后台 - 账号密码登录 Request VO")
public class AuthLoginReqVO {
    @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "admin")
    @NotEmpty(message = "用户账号不能为空")
    @Length(min = 4, max = 32, message = "用户账号长度为 4-32 位")
    @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
    private String username;

    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotEmpty(message = "密码不能为空")
    @Length(min = 6, max = 16, message = "密码长度为 6-16 位")
    private String password;

    @Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1234")
    @NotEmpty(message = "验证码不能为空")
    private String code;

    @Schema(description = "UUID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1234")
    @NotEmpty(message = "UUID 不能为空")
    private String uuid;

    public AuthLoginReqVO() {
    }

    public AuthLoginReqVO(String username, String password, String code, String uuid) {
        this.username = username;
        this.password = password;
        this.code = code;
        this.uuid = uuid;
    }

    public String getUsername() {
        return username;
    }

    public AuthLoginReqVO setUsername(String username) {
        this.username = username;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public AuthLoginReqVO setPassword(String password) {
        this.password = password;
        return this;
    }

    public String getCode() {
        return code;
    }

    public AuthLoginReqVO setCode(String captcha) {
        this.code = captcha;
        return this;
    }

    public String getUuid() {
        return uuid;
    }

    public AuthLoginReqVO setUuid(String uuid) {
        this.uuid = uuid;
        return this;
    }
}
